/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.fyx.mula.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ydenek
 */
@Entity
@Table(name = "mula_language")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "MulaLanguage.findAll", query = "SELECT m FROM MulaLanguage m"),
    @NamedQuery(name = "MulaLanguage.findByIsoLanguage", query = "SELECT m FROM MulaLanguage m WHERE m.isoLanguage = :isoLanguage"),
    @NamedQuery(name = "MulaLanguage.findByActive", query = "SELECT m FROM MulaLanguage m WHERE m.active = :active")})
public class MulaLanguage implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 3)
    @Column(name = "iso_language")
    private String isoLanguage;
    @Lob
    @Size(max = 65535)
    @Column(name = "name")
    private String name;
    @Column(name = "active")
    private Boolean active;

    public MulaLanguage() {
    }

    public MulaLanguage(String isoLanguage) {
        this.isoLanguage = isoLanguage;
    }

    public String getIsoLanguage() {
        return isoLanguage;
    }

    public void setIsoLanguage(String isoLanguage) {
        this.isoLanguage = isoLanguage;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Boolean getActive() {
        return active;
    }

    public void setActive(Boolean active) {
        this.active = active;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (isoLanguage != null ? isoLanguage.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MulaLanguage)) {
            return false;
        }
        MulaLanguage other = (MulaLanguage) object;
        if ((this.isoLanguage == null && other.isoLanguage != null) || (this.isoLanguage != null && !this.isoLanguage.equals(other.isoLanguage))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return isoLanguage;
    }
}
